package com.lagou.service;

import com.alibaba.fastjson.JSON;

/**
 * Description: JSONSerializer.
 *
 * @author Wengy
 * @since JDK 1.8
 * @since 1.0.0
 */
public class JSONSerializer implements Serializer {
    
    
    
    @Override
    public byte[] serialize(Object object) {
        
        return JSON.toJSONBytes(object);
        
    }
    
    
    
    @Override
    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        
        return JSON.parseObject(bytes, clazz);
        
    }
    
}